10. Price Analysis Using the GBM Model

PRDTM2-787 AI Trading C4 L3 Vid9 Price Analysis Using The GBM Model

Using Geometric Brownian Motion for Stock Price Analysis

Learn to create a function to analyze stock prices and advise actions. This involves the following steps:

Data Preparation

  • Historical Price Table: Contains two columns - "Day" for the date and "Closing Price."
  • Primary Key: The "Day" column ensures unique daily price entries.

The analyze Function

  • Goal: Calibrate the model for a specific date and forecast future stock prices.
  • Argument: The function takes which_day as input to perform analysis.
  • Data Fetching: Retrieve the latest 120 daily closing prices.

Analysis Process

  1. Model Initialization: Declare a Geometric Brownian Motion (GBM) model.
  2. Calibration: Tune model parameters using historical data within the lookback window.
  3. Forecasting: Predict stock prices 10 days ahead with varying confidence levels.
  4. Risk Management: Calculate expected shortfall for a 10-day period, aiding in risk assessment.
  5. Decision Making: Output determines whether to buy, sell, or hold shares.